import load from 'load-script';

export const loadScript = (src: string) => {
  return new Promise<HTMLScriptElement>((resolve, reject) => {
    load(src, (error, script) => {
      error ? reject(error) : resolve(script);
    });
  });
};
